package com.kakarote.crm9.utils;

import com.jfinal.aop.Inject;
import com.kakarote.crm9.erp.ding.entity.DingConfig;
import com.kakarote.crm9.erp.ding.service.DingConfigService;

import net.sf.json.JSONObject;

import java.util.HashMap;
import java.util.Map;

public class DingUtils {
    @Inject
    private DingConfigService dingConfigService;

    /*发送工作通知组合json*/
    public JSONObject toSendMsg(String userId, String msg){
        Map<String,Object> json1 = new HashMap<String, Object>();
        Map<String,Object> json2 = new HashMap<String, Object>();
        Map<String,Object> json3 = new HashMap<String, Object>();
        json3.put("content",msg);
        json2.put("msgtype","text");
        json2.put("text",json3);
        json1.put("agent_id", Env.AGENTID);
        json1.put("userid_list",userId);
        json1.put("msg",json2);
        JSONObject jsonObject = JSONObject.fromObject(json1);
        return jsonObject;
    }

}
